Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Twingle Shop #69

Merged
merged 14 commits into from
Sep 3, 2024

Conversation

MarcMichalsky
Copy link
Contributor

@MarcMichalsky MarcMichalsky commented Jun 12, 2023

This PR aims to integrate Twingle Shop orders with CiviCRM.

Objective

The objective of this Twingle Shop integration is not to blow up CiviCRM into a full-grown merchandise management system. For this reason I decided to not create a separate entity for shop orders.

On the other hand, orders should not only be attached to contributions as custom fields or notes, as this is not useful for optimizing order processes in my opinion. A workflow that also maps invoicing, status and shipping in CiviCRM after an order would be extremely inconvenient this way.

Therefore, I came to the conclusion that a viable solution is to map orders as contributions with line items and shops as price sets. This way, orders that do not arrive via the Twingle Shop, but e.g. by phone or mail, can be processed with the same workflow.

In order to match the created Twingle Shops with the existing price sets in CiviCRM, I want to use the Twingle API. Unlike in this extension, the communication is not from Twingle to CiviCRM but the other way round: CiviCRM retrieves the existing shops and products from Twingle and creates the corresponding price sets in its database.

Furthermore, the Twingle Shop integration will be completely optional, so that the behavior of this extension will not change in any way for users who do not use the Twingle Shop.

Tasks

  • process Twingle Shop orders
  • make the display of Twingle Shop settings optional
  • create API3 call to retrieve shop data from Twingle
  • create price sets and price fields from retrieved data
  • create a hook on incoming order
  • write some tests
  • create translations

This PR is work in progress!

@MarcMichalsky
Copy link
Contributor Author

Rebased on PR #71

@jensschuppe jensschuppe mentioned this pull request Aug 15, 2023
@MarcMichalsky MarcMichalsky force-pushed the integrate_twingle_shop branch 2 times, most recently from c57cd39 to a1b17cf Compare October 5, 2023 12:50
@MarcMichalsky MarcMichalsky force-pushed the integrate_twingle_shop branch 8 times, most recently from 0a0df6a to 1e60b37 Compare October 25, 2023 11:44
@MarcMichalsky MarcMichalsky force-pushed the integrate_twingle_shop branch 5 times, most recently from 6b09af8 to afea6f1 Compare November 6, 2023 14:31
@MarcMichalsky MarcMichalsky force-pushed the integrate_twingle_shop branch 2 times, most recently from c7e2616 to c29b658 Compare January 27, 2024 16:21
@MarcMichalsky MarcMichalsky force-pushed the integrate_twingle_shop branch 4 times, most recently from 7d2d98f to 771479d Compare March 18, 2024 16:53
@RoWo-DS
Copy link

RoWo-DS commented Aug 12, 2024

Hi Marc, is this PR ready to be merged into master? Or do you need anything to make that happen? Best wishes! Daniel

@jensschuppe
Copy link
Collaborator

I rebased onto current master again, merge conflicts solved in a way that this branch is now identical to @MarcMichalsky's master branch.

@jensschuppe jensschuppe added the status:needs work There is code, but it needs additional work before it should be reviewed label Sep 2, 2024
@MarcMichalsky
Copy link
Contributor Author

Hello everyone,

Unfortunately I haven't had time to write any tests yet. However, we have been running the shop integration since Christmas in my organization.

I think it would be good if we could set up a kind of test framework that includes all the functions of the extension. Further tests for the shop integration could then be added there. I noticed somewhere that you had already written down a few ideas for this, @jensschuppe?

@jensschuppe
Copy link
Collaborator

@MarcMichalsky I think you're referring to #98 - which is basically about mocking requests to the various API endpoints/actions.

I thought the write some tests part of this PR was about unit tests. Anyway, both tasks can be follow-up issues for not blocking a merge of the shop functionality. I think you and maybe @RoWo-DS running this in production (with prior manual testing) would suffice for releasing a new version of the extension with it.

@jensschuppe jensschuppe added status:needs review Code needs review and testing and removed status:needs work There is code, but it needs additional work before it should be reviewed labels Sep 3, 2024
@jensschuppe jensschuppe merged commit 26132e7 into systopia:master Sep 3, 2024
0 of 10 checks passed
@jensschuppe jensschuppe added status:fixed The issue has been resolved (usually by committing/merging code) and removed status:needs review Code needs review and testing labels Sep 3, 2024
@jensschuppe
Copy link
Collaborator

This has now been released with version 1.5-beta.

@MarcMichalsky feel free to open follow-up issues for the remaining tasks. Thanks again for your work (and patience with the reviews)! 👍

@RoWo-DS
Copy link

RoWo-DS commented Sep 3, 2024

I successfully tested the final pull request for regular donations and donations made with the Twingle shop (sync CiviCRM campaign to twinglemanager and sync donation from twinglemanager to CiviCRM).

@MarcMichalsky
Copy link
Contributor Author

Thanks @jensschuppe! I will tackle the testing in a follow-up issue.

@RoWo-DS And can you also synchronize the Twingle Shop products as line items?

@RoWo-DS
Copy link

RoWo-DS commented Sep 3, 2024

@RoWo-DS And can you also synchronize the Twingle Shop products as line items?

I don't know. Probably not. Where would I find the line items in CiviCRM? Do I need a special configuration to synchronise them from the twinglemanager?

Update: I found the neccessary configuration within the Twingle API profile. It works, the shop products are synchronised as line items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new feature status:fixed The issue has been resolved (usually by committing/merging code)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants